import vue from 'vue'
import Vuex from 'vuex'
vue.use(Vuex)
export default {
    namespaced: true,
    state: {
        Object: ['数学', '前端'],
        num: 123456
    },
    getters: {
        changeObject(state, val) {
            return state.num
        }
    },
    mutations: {
        changemath(state, val) {
            state.Object[0] = 'math'
        },
        changechina(state, val) {
            Vue.set(state.Object, 'WEB', val)
            // state.Object[1] = 'WEB'
        }
    },
    actions: {
        changechinese(context, val) {
            setTimeout(function () {
                context.commit('changechina', val)
            }, 1000)
            console.log(context);
        }
    },
    modules: {}
}